<script type="text/javascript" charset="utf-8">
var t="<?php echo $_POST['trockentemperatur']?>";
var f="<?php echo $_POST['feuchttemperatur']?>";
var von="<?if ($_POST['zeitraum']=="vonbis") echo $_POST['von'] ; else echo $_POST['zeitraum'];?>";
var bis="<?if ($_POST['zeitraum']=="vonbis") echo $_POST['bis'] ; else echo date("Y-m-d H:i:s", strtotime('0 day'));?>";
		$(document).ready(function() {
			
		    $('#temp').dataTable( {
		    	"aaSorting": [],
		    	"bJQueryUI": true,
		    	"bInfo": true,
		    	
				"sPaginationType": "full_numbers",
				"sSwfPath": "../DataTables-1.8.2/extras/TableTools/media/swf/copy_cvs_xls_pdf.swf",
				//"bProcessing": true,
				"bServerSide": true,
		        "sAjaxSource":"tabellen/temperatur_server_processing.php?zeit_von="+von+"&zeit_bis="+bis+"&tempTrockenAVG="+t+"&tempFeuchtAVG="+f,
		       
		        // "sDom": '<"H"lrT>t<"F"ip>',
		        "sDom": '<"H"lr<?php if($_SESSION['berechtiger_user']==1)echo 'T'?>>t<"F"ip>',
		        //"sDom": 'T<"clear">lfrtip',

		        "oLanguage": {
		        	"sZeroRecords":"es wurde kein Messdaten in DB gefunden",
			    	"sInfoFiltered":"",
		            "sLengthMenu": 'Display <select>'+
		              '<option value="10">10</option>'+
		              '<option value="100">100</option>'+
		              '<option value="1000">1000</option>'+
		              '<option value="10000">10000</option>'+
		              
		              
		             // '<option value="-1">All</option>'+
		              '</select> records'
		          },
		        
				"oTableTools": {
					"aButtons": [
						  
						 //"ajax",
						 {
		                        "sExtends": "csv",
		                        "sTitle": "Temperatur",
		                        "sPdfMessage": "Info",
		                        "sFileName": "<?php print('Temperatur.csv'); ?>.csv",
		                        "sPdfOrientation": "landscape",
		                        "sToolTip": "Save as CSV"
		                    },
						 {
		                        "sExtends": "pdf",
		                        "sTitle": "Temperatur",
		                        "sPdfMessage": "Info",
		                        "sFileName": "<?php print('Temperatur.pdf'); ?>.pdf",
		                        "sPdfOrientation": "landscape",
		                        "sToolTip": "Save as PDF"
		                    }

						
					]
					
				}
			
		    } );
		    /*

			jQuery('#temp').dataTable( {
                "bProcessing": true,
                "bServerSide": true,
                "sDom": 'T<"clear">lfrtip',
                "sPaginationType": "full_numbers",
                "sAjaxSource": "tabellen/temperatur_server_processing.php?zeit=2011-03-04 21:44:00&tempTrockenAVG="+a+"&tempFeuchtAVG="+b,
                "fnServerData": function ( sSource, aoData, fnCallback ) {
                    jQuery.ajax( {
                        "dataType": 'json',
                        "type": "GET",
                        "url": sSource,
                        "data": aoData,
                        "success": fnCallback
                    } );
                }
             
            } );
			 */
		} );

	
		</script>
		<h1 align="center">Temperatur</h1>
		<table cellpadding="0" cellspacing="0" border="0" class="display" id="temp">
	<thead>
		<tr>
			<th>Temperatur-Zeit</th>
		
		<?php if($_POST['trockentemperatur']=='tempTrockenAVG') echo "<th>Trocken Temperatur &deg;C</th>";
			if($_POST['feuchttemperatur']=='tempFeuchtAVG') echo "<th>Feucht Temperatur &deg;C</th>";
			?>
		</tr>
	</thead>
	<tbody>
	
	<tr>
			<td colspan="5" class="dataTables_empty">Loading data from DB server</td>

		</tr>
	
		</tbody>
	<tfoot>
		<tr>
		<th>Temperatur-Zeit</th>	
	
			<?php if($_POST['trockentemperatur']=='tempTrockenAVG') echo "<th>Trocken Temperatur &deg;C</th>";
			if($_POST['feuchttemperatur']=='tempFeuchtAVG') echo "<th>Feucht Temperatur &deg;C</th>";
			?>	
		</tr>
	</tfoot>
</table>
